<script>
	$(function() {
		
		// 수정 버튼
		$(".article_footer a.icon_button.modify").click(function() {	
			href = $(this).attr("href");
			title = '{result->ay_name} 수정';
			
			
			loadDialogForm(href, null, title, 600, 350, null, 'modify');
			
			return false;
		});
		
		
		$(".article_footer a.icon_button.delete").click(function() {
			if(confirm('{result->ay_name} 기념일을 삭제하시겠습니까?')) {
				$.ajax({
					 url : $(this).attr("href")
					,success:function(data){
						if(data.code == mesg.success) {
							sagapo.section_refresh('{action}', true);
						} else {
							alert(data.msg);
						}
						
						return false;
					}
				});
				
			} 
			
			return false;
		});
	});
</script>

<div class="article_header">
	<h4>{result->ay_name}</h4>
	<div class="close">
		<button type="button">닫기</button>
	</div>
</div>


<div class="article">
	<div class="info">
		{result->date} <span class="{result->sr_css}">({result->solar})</span>
	</div>
	<hr class="hr" />
	<div class="days">{result->days}</div>	
	<hr class="hr" />
	
	{? result->future_schedule->is}
	<table class="table">
		<caption>
			향후 기념일 일정
		</caption>
		<colgroup>
			<col class="name" />
			<col />
		</colgroup>
		<tbody>
			{@ result->future_schedule->list}
			<tr>
				<td class="txt_center">{.value_->name}</td>
				<td>{.value_->day}</td>
			</tr>
			{/}
		</tbody>
	</table>	
	{:}
	<div class="repeat">{result->date} 기준으로 <span class="blue">{result->interval->y+1} (만 {result->interval->y})</span>세 총 <span class="red">{result->interval->days} </span>일이 지났습니다.</div>
	{/}
</div>

<div class="article_footer">
	<div class="btn_left">
		<a href="{action}/view/{result->ay_seq}" class="icon_button refresh" title="새로고침">새로고침</a>
	</div>
	
	<div class="btn_right">
		<a href="{action}/modify/{result->ay_seq}" class="icon_button modify" title="수정">수정</a>
		<a href="{action}/doDelete/{result->ay_seq}" class="icon_button delete" title="삭제">삭제</a>
	</div>	 
</div>
